﻿Public MustInherit Class Angriffstabelle
    Inherits ObjektTabelle
    Protected INF As Integer = -1
    Protected MECH As Integer = -1
    Protected SSIEINHEIT As Integer = -1
    Protected JGPZ As Integer = -1
    Protected KPZ As Integer = -1
    Protected TITANPZ As Integer = -1
    Protected MEGAPZ As Integer = -1
    Protected SPÄHER As Integer = -1
    Protected FLAK As Integer = -1
    Protected MISSILE As Integer = -1
    Protected ART As Integer = -1
    Protected RKW As Integer = -1
    Protected LÄUFER As Integer = -1
    Protected TTP As Integer = -1
    Protected HÖLLIUM As Integer = -1
    Protected LBOOT As Integer = -1
    Protected SBOOT As Integer = -1
    Protected KREUZER As Integer = -1
    Protected UBOOT As Integer = -1
    Protected FLTR As Integer = -1
    Protected SCHLFF As Integer = -1
    Protected THELI As Integer = -1
    Protected KHELI As Integer = -1
    Protected TARNK As Integer = -1
    Protected JÄGER As Integer = -1
    Protected BOMBER As Integer = -1
    Protected SBOMBE As Integer = -1
    Protected Gebäude As Integer = -1
    Protected ABPZ As Integer = -1
    Protected TTLÄUFER As Integer = -1
    Protected HOVERCRAFT As Integer = -1
    Protected TFLUGZEUG As Integer = -1
    Protected ZEPPELIN As Integer = -1
    Protected ZERSTÖRER As Integer = -1
    Protected AUFKLÄRER As Integer = -1
    Protected DREADNAUGHT As Integer = -1
    Protected BAUPANZER As Integer = -1
    Protected V3Raketenwerfer As Integer = -1
    Protected TRITON As Integer = -1
    Protected VERSORGUNGSSCHIFF As Integer = -1
    Protected HOVERFLAK As Integer = -1
    Protected SCHWERESHOVERCRAFT As Integer = -1
    Protected FLARE As Integer = -1
    Protected MOTORRAD As Integer = -1
    Protected PANZERABWEHRKANONE As Integer = -1
    Protected WASSERFLUGZEUG As Integer = -1
    Protected KANONENBOOT As Integer = -1
    Protected CUSTOMUNITS As Integer() = {}
    Protected CUSTOMUNITIDS As String() = {}
    Public Overrides Function GetWert(ByVal Name As String) As Integer
        Select Case Name.ToUpper
            Case "ABPZ"
                Return ABPZ
            Case "ART"
                Return ART
            Case "AUFKLÄRER"
                Return AUFKLÄRER
            Case "BOMBER"
                Return BOMBER
            Case "FLAK"
                Return FLAK
            Case "FLTR"
                Return FLTR
            Case MovementSorts.Höllium.ToString.ToUpper
                Return HÖLLIUM
            Case "HOVERCRAFT"
                Return HOVERCRAFT
            Case "INF"
                Return INF
            Case "JGPZ"
                Return JGPZ
            Case "JÄGER"
                Return JÄGER
            Case "K-HELI"
                Return KHELI
            Case "KPZ"
                Return KPZ
            Case "KREUZER"
                Return KREUZER
            Case "L-BOOT"
                Return LBOOT
            Case "LÄUFER"
                Return LÄUFER
            Case MovementSorts.Mech.ToString.ToUpper
                Return MECH
            Case "MEGAPZ"
                Return MEGAPZ
            Case "MISSILE"
                Return MISSILE
            Case "RKW"
                Return RKW
            Case "SSIEINHEIT"
                Return SSIEINHEIT
            Case "SCHLFF"
                Return SCHLFF
            Case "S-BOMBE"
                Return SBOMBE
            Case "S-BOOT"
                Return SBOOT
            Case "SPÄHER"
                Return SPÄHER
            Case "TARNK"
                Return TARNK
            Case "TITANPZ"
                Return TITANPZ
            Case "T-FLUGZEUG"
                Return TFLUGZEUG
            Case "T-HELI"
                Return THELI
            Case "TTL"
                Return TTLÄUFER
            Case "TTP"
                Return TTP
            Case "U-BOOT"
                Return UBOOT
            Case "ZEPPELIN"
                Return ZEPPELIN
            Case "ZERSTÖRER"
                Return ZERSTÖRER
            Case "GEBÄUDE"
                If TypeOf Me Is AngriffstabelleLuftraketen And Objektverwalter.Spielfeld.MomentaneSchlacht = ObjektSpielfeld.Luftschlacht Then
                    'Jäger können in der Luftschlacht Gebäude angreifen
                    Return 55
                Else
                    Return Gebäude
                End If
            Case "DREADNAUGHT"
                Return DREADNAUGHT
            Case "V3RAKETENWERFER"
                Return V3Raketenwerfer
            Case "BAUPANZER"
                Return BAUPANZER
            Case "TRITON"
                Return TRITON
            Case "VERSORGUNGSSCHIFF"
                Return VERSORGUNGSSCHIFF
            Case "HOVERFLAK"
                Return HOVERFLAK
            Case "SCHWERESHOVERCRAFT"
                Return SCHWERESHOVERCRAFT
            Case "MOTORRAD"
                Return MOTORRAD
            Case "FLARE"
                Return FLARE
            Case "PANZERABWEHRKANONE"
                Return PANZERABWEHRKANONE
            Case "WASSERFLUGZEUG"
                Return WASSERFLUGZEUG
            Case "KANONENBOOT"
                Return KANONENBOOT
            Case Else
                For I = 0 To CUSTOMUNITS.Length - 1
                    If CUSTOMUNITIDS(I) = Name Then
                        Return CUSTOMUNITS(I)
                    End If
                Next
                Return -1
        End Select
    End Function

    Public Overrides Sub SetWert(ByVal Name As String, ByVal Wert As Integer)
        Select Case Name.ToUpper
            Case "ABPZ"
                ABPZ = Wert
            Case "ART"
                ART = Wert
            Case "AUFKLÄRER"
                AUFKLÄRER = Wert
            Case "BOMBER"
                BOMBER = Wert
            Case "FLAK"
                FLAK = Wert
            Case "FLTR"
                FLTR = Wert
            Case MovementSorts.Höllium.ToString.ToUpper
                HÖLLIUM = Wert
            Case "HOVERCRAFT"
                HOVERCRAFT = Wert
            Case "INF"
                INF = Wert
            Case "JGPZ"
                JGPZ = Wert
            Case "JÄGER"
                JÄGER = Wert
            Case "K-HELI"
                KHELI = Wert
            Case "KPZ"
                KPZ = Wert
            Case "KREUZER"
                KREUZER = Wert
            Case "L-BOOT"
                LBOOT = Wert
            Case "LÄUFER"
                LÄUFER = Wert
            Case MovementSorts.Mech.ToString.ToUpper
                MECH = Wert
            Case "MEGAPZ"
                MEGAPZ = Wert
            Case "MISSILE"
                MISSILE = Wert
            Case "RKW"
                RKW = Wert
            Case "SSIEINHEIT"
                SSIEINHEIT = Wert
            Case "SCHLFF"
                SCHLFF = Wert
            Case "S-BOMBE"
                SBOMBE = Wert
            Case "S-BOOT"
                SBOOT = Wert
            Case "SPÄHER"
                SPÄHER = Wert
            Case "TARNK"
                TARNK = Wert
            Case "TITANPZ"
                TITANPZ = Wert
            Case "T-FLUGZEUG"
                TFLUGZEUG = Wert
            Case "T-HELI"
                THELI = Wert
            Case "TTL"
                TTLÄUFER = Wert
            Case "TTP"
                TTP = Wert
            Case "U-BOOT"
                UBOOT = Wert
            Case "ZEPPELIN"
                ZEPPELIN = Wert
            Case "ZERSTÖRER"
                ZERSTÖRER = Wert
            Case "GEBÄUDE"
                Gebäude = Wert
            Case "DREADNAUGHT"
                DREADNAUGHT = Wert
            Case "V3RAKETENWERFER"
                V3Raketenwerfer = Wert
            Case "BAUPANZER"
                BAUPANZER = Wert
            Case "TRITON"
                TRITON = Wert
            Case "VERSORGUNGSSCHIFF"
                VERSORGUNGSSCHIFF = Wert
            Case "HOVERFLAK"
                HOVERFLAK = Wert
            Case "SCHWERESHOVERCRAFT"
                SCHWERESHOVERCRAFT = Wert
            Case "MOTORRAD"
                MOTORRAD = Wert
            Case "FLARE"
                FLARE = Wert
            Case "PANZERABWEHRKANONE"
                PANZERABWEHRKANONE = Wert
            Case "WASSERFLUGZEUG"
                WASSERFLUGZEUG = Wert
            Case "KANONENBOOT"
                KANONENBOOT = Wert
            Case Else
                AddCustomUnit(Name, Wert)
        End Select
    End Sub
    Protected Function GetUnit(ByVal ID As String) As ObjektEinheit
        For Each E In Objektverwalter.AlleEinheiten
            If E.EinheitenID = ID Then
                Return E.Einheit
            End If
        Next
        Return Nothing
    End Function
    Public Sub AddCustomUnit(ByVal ID As String, ByVal DAMAGE As Integer)
        Array.Resize(CUSTOMUNITIDS, CUSTOMUNITIDS.Length + 1)
        Array.Resize(CUSTOMUNITS, CUSTOMUNITS.Length + 1)
        CUSTOMUNITIDS(CUSTOMUNITIDS.Length - 1) = ID
        CUSTOMUNITS(CUSTOMUNITS.Length - 1) = DAMAGE
    End Sub
    ''' <summary>
    ''' Löscht alle Werte!
    ''' </summary>
    ''' <remarks></remarks>
    Protected Sub Reset()
        INF = -1
        MECH = -1
        SSIEINHEIT = -1
        JGPZ = -1
        KPZ = -1
        TITANPZ = -1
        MEGAPZ = -1
        SPÄHER = -1
        FLAK = -1
        MISSILE = -1
        ART = -1
        RKW = -1
        LÄUFER = -1
        TTP = -1
        HÖLLIUM = -1
        LBOOT = -1
        SBOOT = -1
        KREUZER = -1
        UBOOT = -1
        FLTR = -1
        SCHLFF = -1
        THELI = -1
        KHELI = -1
        TARNK = -1
        JÄGER = -1
        BOMBER = -1
        SBOMBE = -1
        Gebäude = -1
        ABPZ = -1
        TTLÄUFER = -1
        HOVERCRAFT = -1
        TFLUGZEUG = -1
        ZEPPELIN = -1
        ZERSTÖRER = -1
        AUFKLÄRER = -1
        DREADNAUGHT = -1
        BAUPANZER = -1
        V3Raketenwerfer = -1
        TRITON = -1
        VERSORGUNGSSCHIFF = -1
        HOVERFLAK = -1
        SCHWERESHOVERCRAFT = -1
        FLARE = -1
        MOTORRAD = -1
        PANZERABWEHRKANONE = -1
        WASSERFLUGZEUG = -1
        KANONENBOOT = -1
        For I = 0 To CUSTOMUNITS.Length - 1
            CUSTOMUNITS(I) = -1
        Next
    End Sub
End Class
